{% if post %}
  {% assign category_size = post.categories | size %}
  {% if category_size > 0 %}
    <span class="item">
      <i class="fa fa-th-list"></i>
      {% for category in post.categories %}
        <!--<span class="label label-black">-->
          <a href="/category/#{{category}}">{{category}}</a>
        <!--</span>-->
      {% endfor %}
    </span>
  {% endif %}
{% else if page %}
  {% assign category_size = page.categories | size %}
  {% if category_size > 0 %}
  <span class="item">
    <i class="fa fa-th-list"></i>
    {% for category in page.categories %}
      <!--<span class="label label-black">-->
        <a href="/category/#{{category}}">{{category}}</a>
      <!--</span>-->
    {% endfor %}
  </span>
  {% endif %}
{% endif %}